<?php

/*
 * Elaboraco Por: Ebrain Cedeno.
 */

//seleccionando el directorio raiz

session_start();
define('PATH_ROOT', __DIR__);

//cargando el archivo de configuracion del sistema

$config = 'config'.DIRECTORY_SEPARATOR;
include $config."main.php";

$base = 'base'.DIRECTORY_SEPARATOR.'framework'.DIRECTORY_SEPARATOR;

include $base.'class.Templete.inc.php';
include $base.'class.Controller.inc.php';
include $base.'class.TWidget.inc.php';

$directory = array_diff(scandir($base), array('.','..','index.php','class.Controller.inc.php','class.Templete.inc.php','class.TWidget.inc.php'));

foreach ($directory as $llave=>$class_php){
    include $base.$class_php;
}

//creando los modelos creados por el usuario

$model = 'model'.DIRECTORY_SEPARATOR;
$directory_model = array_diff(scandir($model), array('..','.','index.php'));

foreach ($directory_model as $llave=>$content_model){
    include $model.$content_model;
}

//cargando los controladores creados por el usuario

$controllers = 'controller'.DIRECTORY_SEPARATOR;
$directory_controllers = array_diff(scandir($controllers), array('.','..','index.php'));

foreach ($directory_controllers as $llave=>$content_controllers){
    include $controllers.$content_controllers;
}

//cargamos la configuracion como objeto

VeCms::$app = $configureObject;

//conectando a la base de datos

ActiveRecord::$host = VeCms::$app->data_base["host"];
ActiveRecord::$user = VeCms::$app->data_base["user"];
ActiveRecord::$passwd = VeCms::$app->data_base["passwd"];
ActiveRecord::$port = VeCms::$app->data_base["port"];
ActiveRecord::$dbname = VeCms::$app->data_base["dbname"];
ActiveRecord::$type = VeCms::$app->data_base["type"];

?>
